package aom.ju.ss.utils

import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit

object ThreadUtils {
    private var threadPoolExecutor: ThreadPoolExecutor? = null

    fun get(): ThreadPoolExecutor {
        if (threadPoolExecutor == null) {
            threadPoolExecutor = ThreadPoolExecutor(
                30, 500, 1, TimeUnit.SECONDS,
                LinkedBlockingQueue(100)
            )
        }

        return threadPoolExecutor!!
    }

}